﻿@{
    ViewBag.Title = "Import";
    ViewBag.Menu = "数据录入";

    var error = ViewBag.ErrorMessage ?? "";
}

<style type="text/css">
    .downbtn {
        width: 200px;
        height: 22px;
        text-align: center;
        vertical-align: central;
        text-align: center;
        border: 1px solid #ccc;
        border-radius: 2px;
        background: #DADADA;
        color: #000;
        cursor: auto;
        display: inline-block;
        text-decoration: none;
    }

    .txtSty {
        width: 560px;
        height: 35px;
        text-align: left;
        padding-left: 3px;
        vertical-align: central;
    }

    .importbtn {
        width: 100px;
        height: 28px;
        text-align: center;
        vertical-align: central;
        margin-left: 20px;
    }

    .divSty {
        width: 100%;
        padding-top: 50px;
        font-family: 'Microsoft YaHei';
    }

    .tbsty {
        width: 100%;
        margin-top: 100px;
    }

    .btnSty_import {
        width: 32px;
        height: 32px;
        margin: 0px 10px auto auto;
        vertical-align: central;
        background: url(../../images/impDb_p.png) no-repeat;
        background-size: cover;
        border: 0px;
        cursor: pointer;
    }

    .btnSty_download {
        width: 32px;
        height: 32px;
        margin: 0px 10px auto auto;
        vertical-align: central;
        background: url(../../images/download.png) no-repeat;
        background-size: cover;
        border: 0px;
        cursor: pointer;
    }

    .aSty {
        width: 130px;
        height: 32px;
        line-height: 32px;
        vertical-align: central;
        margin: auto auto auto 10px;
        text-align: center;
        vertical-align: central;
        text-align: center;
        background: #2573c7;
        color: #fff;
        border: 0px;
        cursor: pointer;
        display: inline-block;
        text-decoration: none;
    }

    #input-file {
        position: relative; /* 保证子元素的定位 */
        width: 130px;
        height: 32px;
        background: #2573c7;
        border: 0px;
        text-align: center;
        cursor: pointer;
        float: left;
    }

    #text {
        line-height: 32px;
        color: #fff;
        /*font-family: "黑体";
        font-size: 18px;*/
    }

    .fileSty {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        width: 120px; /* 宽高和外围元素保持一致 */
        height: 30px;
        opacity: 0;
        -moz-opacity: 0; /* 兼容老式浏览器 */
        filter: alpha(opacity=0); /* 兼容IE */
    }
</style>

<div class="divSty">


    <table class="tbsty">
        <tr>
            <td style="width: 200px"></td>
            <td style="width: 580px; text-align: left">
                <a href="/Template.xls" title="下载导入模板" class="aSty">下载导入模板</a>
            </td>
            <td></td>
        </tr>
        <tr>
            <td></td>
            <td>
                <div id="resultMessage" style="color:red;"></div>
            </td>
            <td></td>
        </tr>
        <tr style="height: 33px">
            <td></td>
            <td></td>
            <td></td>
        </tr>
        @using (Html.BeginForm("Import", "Land", FormMethod.Post, new { enctype = "multipart/form-data" }))
        {
            <tr>
                <td></td>

                <td>
                    <div id="input-file">
                        <span id="text">选择文件</span>
                        <input type="file" name="landfile" class="fileSty" />
                    </div>

                    <input id="Button2" type="submit" class="aSty" value="导入excel" />
                </td>
                @*<td style="float:initial">
                        <input id="Button2" type="submit" class="btnSty_import" value=" " />
                    </td>*@
            </tr>
        }

    </table>
</div>

<script type="text/javascript">
    $("#resultMessage").html('@error');
</script>